package com.example.combwyaq.visualinterface.people;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.example.combwyaq.R;
import com.example.combwyaq.visualinterface.people.adapter.PeopleVpAdapter;
import com.flyco.tablayout.SlidingTabLayout;

public class PeoPleFragment extends Fragment {
    private View rootView;
    private SlidingTabLayout people_tab;
    private ViewPager people_vp;
    private PeopleVpAdapter adapter;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        rootView=inflater.inflate(R.layout.fragment_main_fragment_pop,container,false);
        init();
        return rootView;
    }

    private void init() {
        people_tab=rootView.findViewById(R.id.people_tab);
        people_vp=rootView.findViewById(R.id.people_vp);
        adapter=new PeopleVpAdapter(getFragmentManager());
        people_vp.setAdapter(adapter);
        people_tab.setViewPager(people_vp);


    }
}
